package tv.acgn.advertisement.index.po.unit_condition;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

/**
 * @program: advertisement-ad-publish-po
 * @description:
 * @author: junG
 * @create: 2019-04-29 23:33
 **/

@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "ad_unit_it")
@Entity
@DynamicInsert
@DynamicUpdate
public class AdUnitInterest {

    @Id
    @Column(name = "unit_it_id", nullable = false, unique = true, length = 64)
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "uuid")
    private String unitInterestId;

    @Column(name = "unit_id", nullable = false)
    private String unitId;

    @Column(name = "it_tag", nullable = false, unique = true)
    private String interestTag;

    public AdUnitInterest(String unitId, String itTag) {
        this.unitId = unitId;
        this.interestTag = itTag;
    }
}
